<template>
  <div>
    <el-container>
      <el-aside width="200px">
        <el-row class="tac">
          <el-col>
            <el-menu
              default-active="2-1"
              class="el-menu-vertical-demo"
              background-color="#314254"
              text-color="#fff"
              active-text-color="#0076ff"
            >
              <el-menu-item index="1">
                <i class="el-icon-menu"></i>
                <span slot="title">首页</span>
              </el-menu-item>
              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-document"></i>
                  <span>数据管理</span>
                </template>
                <el-menu-item @click="goUser" index="2-1">用户管理</el-menu-item>
                <el-menu-item @click="goShop" index="2-2">商家列表</el-menu-item>
                <el-menu-item index="2-3">食品列表</el-menu-item>
                <el-menu-item index="2-4">订单列表</el-menu-item>
                <el-menu-item index="2-5">管理员列表</el-menu-item>
              </el-submenu>

              <el-submenu index="3">
                <template slot="title">
                  <i class="el-icon-plus"></i>
                  <span>添加数据</span>
                </template>
              </el-submenu>
              <el-submenu index="4">
                <template slot="title">
                  <i class="el-icon-star-on"></i>
                  <span>图表</span>
                </template>
              </el-submenu>
              <el-submenu index="5">
                <template slot="title">
                  <i class="el-icon-edit"></i>
                  <span>编辑</span>
                </template>
              </el-submenu>
              <el-submenu index="6">
                <template slot="title">
                  <i class="el-icon-s-tools"></i>
                  <span>设置</span>
                </template>
              </el-submenu>
              <el-submenu index="7">
                <template slot="title">
                  <i class="el-icon-warning"></i>
                  <span>说明</span>
                </template>
              </el-submenu>
            </el-menu>
          </el-col>
        </el-row>
      </el-aside>

      <el-container>
        <el-header>
          <span>
            首页 / 数据管理 /
            <span v-show="isUser" class="font_grey">用户管理</span>
            <span v-show="isShop" class="font_grey">商家列表</span>
          </span>
        </el-header>
        <el-main>
          <div>
            
          </div>

          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isUser: true,
      isShop: false,
    };
  },
  methods: {
    goUser() {
      this.isUser = true;
      this.isShop = false;
      this.$router.push("/user");
    },
    goShop() {
      this.isUser = false;
      this.isShop = true;
      this.$router.push("/shoplist");
    },
  },
};
</script>

<style scoped>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
  font-size: 16px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
}
.font_grey {
  color: grey;
}
</style>